/***********************************************************************
 * Module:  DonDatHang.cs
 * Author:  Tuan Nguyen
 * Purpose: Definition of the Class DonDatHang
 ***********************************************************************/

using System;

public class DonDatHang
{
   public long MaDonDatHang;
   public DateTime NgayDatHang;
   public DateTime NgayGiaoHang;
   public bool TinhTrangThanhToan;
   public long Deposit;
   public long TongGiaTriDonHang;
   
   public System.Collections.ArrayList chiTietDonDatHang;
   
   /// <pdGenerated>default getter</pdGenerated>
   public System.Collections.ArrayList GetChiTietDonDatHang()
   {
      if (chiTietDonDatHang == null)
         chiTietDonDatHang = new System.Collections.ArrayList();
      return chiTietDonDatHang;
   }
   
   /// <pdGenerated>default setter</pdGenerated>
   public void SetChiTietDonDatHang(System.Collections.ArrayList newChiTietDonDatHang)
   {
      RemoveAllChiTietDonDatHang();
      foreach (ChiTietDonDatHang oChiTietDonDatHang in newChiTietDonDatHang)
         AddChiTietDonDatHang(oChiTietDonDatHang);
   }
   
   /// <pdGenerated>default Add</pdGenerated>
   public void AddChiTietDonDatHang(ChiTietDonDatHang newChiTietDonDatHang)
   {
      if (newChiTietDonDatHang == null)
         return;
      if (this.chiTietDonDatHang == null)
         this.chiTietDonDatHang = new System.Collections.ArrayList();
      if (!this.chiTietDonDatHang.Contains(newChiTietDonDatHang))
      {
         this.chiTietDonDatHang.Add(newChiTietDonDatHang);
         newChiTietDonDatHang.SetDonDatHang(this);      
      }
   }
   
   /// <pdGenerated>default Remove</pdGenerated>
   public void RemoveChiTietDonDatHang(ChiTietDonDatHang oldChiTietDonDatHang)
   {
      if (oldChiTietDonDatHang == null)
         return;
      if (this.chiTietDonDatHang != null)
         if (this.chiTietDonDatHang.Contains(oldChiTietDonDatHang))
         {
            this.chiTietDonDatHang.Remove(oldChiTietDonDatHang);
            oldChiTietDonDatHang.SetDonDatHang((DonDatHang)null);
         }
   }
   
   /// <pdGenerated>default removeAll</pdGenerated>
   public void RemoveAllChiTietDonDatHang()
   {
      if (chiTietDonDatHang != null)
      {
         System.Collections.ArrayList tmpChiTietDonDatHang = new System.Collections.ArrayList();
         foreach (ChiTietDonDatHang oldChiTietDonDatHang in chiTietDonDatHang)
            tmpChiTietDonDatHang.Add(oldChiTietDonDatHang);
         chiTietDonDatHang.Clear();
         foreach (ChiTietDonDatHang oldChiTietDonDatHang in tmpChiTietDonDatHang)
            oldChiTietDonDatHang.SetDonDatHang((DonDatHang)null);
         tmpChiTietDonDatHang.Clear();
      }
   }
   public System.Collections.ArrayList chiTietHoaDon;
   
   /// <pdGenerated>default getter</pdGenerated>
   public System.Collections.ArrayList GetChiTietHoaDon()
   {
      if (chiTietHoaDon == null)
         chiTietHoaDon = new System.Collections.ArrayList();
      return chiTietHoaDon;
   }
   
   /// <pdGenerated>default setter</pdGenerated>
   public void SetChiTietHoaDon(System.Collections.ArrayList newChiTietHoaDon)
   {
      RemoveAllChiTietHoaDon();
      foreach (ChiTietHoaDon oChiTietHoaDon in newChiTietHoaDon)
         AddChiTietHoaDon(oChiTietHoaDon);
   }
   
   /// <pdGenerated>default Add</pdGenerated>
   public void AddChiTietHoaDon(ChiTietHoaDon newChiTietHoaDon)
   {
      if (newChiTietHoaDon == null)
         return;
      if (this.chiTietHoaDon == null)
         this.chiTietHoaDon = new System.Collections.ArrayList();
      if (!this.chiTietHoaDon.Contains(newChiTietHoaDon))
      {
         this.chiTietHoaDon.Add(newChiTietHoaDon);
         newChiTietHoaDon.SetDonDatHang(this);      
      }
   }
   
   /// <pdGenerated>default Remove</pdGenerated>
   public void RemoveChiTietHoaDon(ChiTietHoaDon oldChiTietHoaDon)
   {
      if (oldChiTietHoaDon == null)
         return;
      if (this.chiTietHoaDon != null)
         if (this.chiTietHoaDon.Contains(oldChiTietHoaDon))
         {
            this.chiTietHoaDon.Remove(oldChiTietHoaDon);
            oldChiTietHoaDon.SetDonDatHang((DonDatHang)null);
         }
   }
   
   /// <pdGenerated>default removeAll</pdGenerated>
   public void RemoveAllChiTietHoaDon()
   {
      if (chiTietHoaDon != null)
      {
         System.Collections.ArrayList tmpChiTietHoaDon = new System.Collections.ArrayList();
         foreach (ChiTietHoaDon oldChiTietHoaDon in chiTietHoaDon)
            tmpChiTietHoaDon.Add(oldChiTietHoaDon);
         chiTietHoaDon.Clear();
         foreach (ChiTietHoaDon oldChiTietHoaDon in tmpChiTietHoaDon)
            oldChiTietHoaDon.SetDonDatHang((DonDatHang)null);
         tmpChiTietHoaDon.Clear();
      }
   }

}